home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Bandit.pxl < prev    next >
Text File  |  2000-12-23  |  4KB  |  159 lines

  1. Initialize:
  2.     SetColorPalette(GENERATE) 
  3.     WinGetActive(Win$)
  4.     UseCoordinates(PIXEL)
  5.     UseBackGround(TRANSPARENT,192,192,192)
  6.     DrawBackGround
  7.     WaitInput(100)  {let NT and 95 catch up}
  8.     WinLocate(Win$,100,100,520,360,Res)
  9.     Title$ = "Slot Machine Example"
  10.     WinTitle(Win$, Title$)
  11.  
  12.     InfoMenu(REMOVE)
  13.     WaitInput(100)
  14.     SetMenu("Exit!",Leave,
  15.         ENDPOPUP,
  16.         "Play",Test,
  17.         ENDPOPUP)
  18.     
  19.     Button(100,150,200,180,PUSH,"Play",Test)
  20.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  21.     DrawShadeRectangle(cx1,cy1,cx2,cy2, 0,0,0, 0,0,255, TOPBOTTOM)
  22.     GoSub DrawSlotWindows
  23.  
  24. Wait_for_Input:
  25.     WaitInput()
  26.  
  27.  
  28. Leave:
  29.     End
  30.  
  31. Test:
  32.     ix1 =  20
  33.     ix2 = 120
  34.     ix3 = 220
  35.     ix4 = 320
  36.     iy1 = 10
  37.  
  38.     GoSub DrawSlotWindows
  39.     
  40.         GoSub Spin
  41.  
  42.         ix1 = 20
  43.         Random(14,Result)
  44.         GoSub StopSpin
  45.  
  46.         ix1 = 120
  47.         Random(14,Result)
  48.         GoSub StopSpin
  49.  
  50.         ix1 = 220
  51.         Random(14,Result)
  52.         GoSub StopSpin
  53.  
  54.         ix1 = 320
  55.         Random(14,Result)
  56.         GoSub StopSpin
  57.  
  58.     Goto Wait_for_Input
  59.  
  60. {======================================================================}
  61. Spin:
  62.     SpinNumber = 5
  63.     While SpinNumber <> 0
  64.     DrawIcon(ix1,iy1,64,64,ICON01)
  65.     DrawIcon(ix2,iy1,64,64,ICON02)
  66.     DrawIcon(ix3,iy1,64,64,ICON03)
  67.     DrawIcon(ix4,iy1,64,64,ICON04)
  68.     DrawIcon(ix1,iy1,64,64,ICON05)
  69.     DrawIcon(ix2,iy1,64,64,ICON06)
  70.     DrawIcon(ix3,iy1,64,64,ICON07)
  71.     DrawIcon(ix4,iy1,64,64,ICON08)
  72.     DrawIcon(ix1,iy1,64,64,ICON09)
  73.     DrawIcon(ix2,iy1,64,64,ICON10)
  74.     DrawIcon(ix3,iy1,64,64,ICON11)
  75.     DrawIcon(ix4,iy1,64,64,ICON12)
  76.     DrawIcon(ix1,iy1,64,64,ICON13)
  77.     DrawIcon(ix2,iy1,64,64,ICON14)
  78.     WaitInput(1)
  79.     DrawIcon(ix3,iy1,64,64,ICON01)
  80.     DrawIcon(ix4,iy1,64,64,ICON02)
  81.     DrawIcon(ix1,iy1,64,64,ICON03)
  82.     DrawIcon(ix2,iy1,64,64,ICON04)
  83.     DrawIcon(ix3,iy1,64,64,ICON05)
  84.     DrawIcon(ix4,iy1,64,64,ICON06)
  85.     DrawIcon(ix1,iy1,64,64,ICON07)
  86.     DrawIcon(ix2,iy1,64,64,ICON08)
  87.     DrawIcon(ix3,iy1,64,64,ICON09)
  88.     DrawIcon(ix4,iy1,64,64,ICON10)
  89.     DrawIcon(ix1,iy1,64,64,ICON11)
  90.     DrawIcon(ix2,iy1,64,64,ICON12)
  91.     DrawIcon(ix3,iy1,64,64,ICON13)
  92.     DrawIcon(ix4,iy1,64,64,ICON14)
  93.     DrawIcon(ix1,iy1,64,64,ICON01)
  94.     DrawIcon(ix2,iy1,64,64,ICON02)
  95.     DrawIcon(ix3,iy1,64,64,ICON03)
  96.     DrawIcon(ix4,iy1,64,64,ICON04)
  97.     DrawIcon(ix1,iy1,64,64,ICON05)
  98.     DrawIcon(ix2,iy1,64,64,ICON06)
  99.     DrawIcon(ix3,iy1,64,64,ICON07)
  100.     DrawIcon(ix4,iy1,64,64,ICON08)
  101.     DrawIcon(ix1,iy1,64,64,ICON09)
  102.     DrawIcon(ix2,iy1,64,64,ICON10)
  103.     DrawIcon(ix3,iy1,64,64,ICON11)
  104.     DrawIcon(ix4,iy1,64,64,ICON12)
  105.     DrawIcon(ix1,iy1,64,64,ICON13)
  106.     DrawIcon(ix2,iy1,64,64,ICON14)
  107.     DrawIcon(ix3,iy1,64,64,ICON01)
  108.     DrawIcon(ix4,iy1,64,64,ICON02)
  109.     DrawIcon(ix1,iy1,64,64,ICON03)
  110.     DrawIcon(ix2,iy1,64,64,ICON04)
  111.     DrawIcon(ix3,iy1,64,64,ICON05)
  112.     DrawIcon(ix4,iy1,64,64,ICON06)
  113.     DrawIcon(ix1,iy1,64,64,ICON07)
  114.     DrawIcon(ix2,iy1,64,64,ICON08)
  115.     DrawIcon(ix3,iy1,64,64,ICON09)
  116.     DrawIcon(ix4,iy1,64,64,ICON10)
  117.     DrawIcon(ix1,iy1,64,64,ICON11)
  118.     DrawIcon(ix2,iy1,64,64,ICON12)
  119.     DrawIcon(ix3,iy1,64,64,ICON13)
  120.     DrawIcon(ix4,iy1,64,64,ICON14)
  121.     SpinNumber--
  122.     WaitInput(1)    
  123.     EndWhile
  124.     Return
  125.  
  126. StopSpin:
  127.     If Result = 1  Then DrawIcon(ix1,iy1,64,64,ICON01)
  128.     If Result = 2  Then DrawIcon(ix1,iy1,64,64,ICON02)
  129.     If Result = 3  Then DrawIcon(ix1,iy1,64,64,ICON03)
  130.     If Result = 4  Then DrawIcon(ix1,iy1,64,64,ICON04)
  131.     If Result = 5  Then DrawIcon(ix1,iy1,64,64,ICON05)
  132.     If Result = 6  Then DrawIcon(ix1,iy1,64,64,ICON06)
  133.     If Result = 7  Then DrawIcon(ix1,iy1,64,64,ICON07)
  134.     If Result = 8  Then DrawIcon(ix1,iy1,64,64,ICON08)
  135.     If Result = 9  Then DrawIcon(ix1,iy1,64,64,ICON09)
  136.     If Result = 10 Then DrawIcon(ix1,iy1,64,64,ICON10)
  137.     If Result = 11 Then DrawIcon(ix1,iy1,64,64,ICON11)
  138.     If Result = 12 Then DrawIcon(ix1,iy1,64,64,ICON12)
  139.     If Result = 13 Then DrawIcon(ix1,iy1,64,64,ICON13)
  140.     If Result = 14 Then DrawIcon(ix1,iy1,64,64,ICON14)
  141.     Return
  142.  
  143.  
  144. DrawSlotWindows:
  145.     UsePen(SOLID,1,0,255,255)
  146.     UseBrush(SOLID,255,255,255)
  147.     DrawRectangle( 20,10, 84,74)
  148.     DrawRectangle(120,10,184,74)
  149.     DrawRectangle(220,10,284,74)
  150.     DrawRectangle(320,10,384,74)
  151.     
  152.     UseFont("Arial",7,15,NOBOLD,NOITALIC,NOUNDERLINE,255,255,255)
  153.     DrawText(20,90,"Odds of all the same icons are 38,416 : 1")
  154.     DrawText(20,105,"Odds of three icons the same are 2,955 : 1")
  155.     DrawText(20,120,"Odds of two icons the same are 227 : 1")
  156.  
  157.     Return
  158.  
  159.